@extends('layouts.h5')

@section('title', '我的业绩')

@section('content')
    <div class="app commission" id="app">
        <div class="weui-tab">
            {{--<div class="weui-navbar">--}}
                {{--<div class="weui-navbar__item ">业绩记录</div>--}}
                {{--<div class="weui-navbar__item weui-bar__item_on">佣金记录</div>--}}
            {{--</div>--}}
            <div class="weui-tab__panel">
                <div class="weui-cells achievement-cells margin-0">
                    <div class="weui-cell achievement-cell-hd">
                        <div class="flex">日期</div>
                        <div class="amount">节点业绩</div>
                        <div class="amount">节点佣金</div>
                    </div>
                </div>
                <div class="weui-cells achievement-cells margin-0">
                    <div class="weui-cell" v-for="item in items" :key="item.id">
                        <div class="flex">@{{ item.date }}</div>
                        <div class="amount money">@{{ item.node_achievement }}</div>
                        <div class="amount money">@{{ item.node_commission }}</div>
                    </div>
                </div>
            </div>
        </div>
    </div>
@stop

@section('foot')
    <script type="text/javascript">
        var app = new Vue({
            el:'#app',
            data:{
                items:[]
            },
            created:function () {
                this.loadItems();
            },
            methods:{
                loadItems:function () {
                    var $this = this;
                    $.ajax({
                        url:'/h5/commission/getachievements',
                        success:function (response) {
                            $this.items = response.items;
                        }
                    });
                }
            }
        });
    </script>
@stop
